import time

import pyautogui

from src.python.tools.get_all_windows import getAllWindow

if __name__ == '__main__':
    windows = getAllWindow()
    window = windows[0]
    # 判断窗口是否最小化,如果是则恢复
    if window.isMinimized:
        window.restore()
    # 判断窗口是否激活,如果未激活则激活
    if not window.isActive:
        window.activate()
    # 获取当前窗口宽 高
    weight, height = window.width, window.height
    # 移动窗口到左上角
    window.moveTo(0, 0)
    # 设置窗口大小
    window.resizeTo(800, 600)

    for i in range(20):
        print(pyautogui.position())
        time.sleep(2)

    window.resizeTo(weight, height)
